import { GET_USER_DATA, GET_MYROOM_LIST } from "../actionType";

const initState = {
    userData: [],
    myRoomList: []
}

const reducer = (state = initState, action) => {
    const { type, payload } = action
    switch (type) {
        case GET_USER_DATA: return {
            ...state,
            userData: payload
        }
        case GET_MYROOM_LIST: {

            return {
                ...state,
                myRoomList: [...payload]
            }
        }


        default: return {
            ...state
        }

    }
}
export default reducer;